﻿Public Class LoaiPhongDAO
    Dim connect As New connect()
    Public Function GetData() As List(Of LoaiPhongDTO)
        Dim i As Integer
        Dim MaLP, TenLP, BiXoa As String
        Dim LoaiPhongDTO As LoaiPhongDTO
        Dim LoaiPhongList As New List(Of LoaiPhongDTO)
        Dim dt As New DataTable

        dt = connect.GetData("select * from LOAIPHONG")

        For i = 0 To dt.Rows.Count() - 1
            MaLP = dt.Rows(i)("MALP").ToString()
            TenLP = dt.Rows(i)("TENLP").ToString()
            BiXoa = dt.Rows(i)("BIXOA").ToString()
            LoaiPhongDTO = New LoaiPhongDTO(MaLP, TenLP, BiXoa)
            LoaiPhongList.Add(LoaiPhongDTO)
        Next
        Return LoaiPhongList
    End Function
End Class
